#include<bits/stdc++.h>
using namespace std;
int n,m;
int f[1005][(1<<5)][(1<<5)];
int x,start;
const int N=1e9+7;
int main()
{
    freopen("pearl.in","r",stdin);
    freopen("pearl.out","w",stdout);
    cin>>n>>m>>x;
    char tt;
    for(int i=1;i<=m;i++)
    {
        cin>>tt;
        if(tt=='1')
        {
            start+=(1<<(i-1));
        }
    }
    f[0][0][0]=1;
    for(int i=1;i<=n;i++)
    {
        for(int j=0;j<(1<<m);j++)
        {
            for(int k=0;k<(1<<m);k++)
            {
                for(int l=0;l<(1<<m);l++)
                {
                    int kt=k*l;
                    f[i][(j^kt)%(1<<m)][l]+=f[i-1][j][k];
                    f[i][(j^kt)%(1<<m)][l]%=N;
                }
            }
        }
        if(i==x)
        {
            for(int j=0;j<(1<<m);j++)
            {
                for(int k=0;k<(1<<m);k++)
                {
                    if(k!=start)
                    {
                        f[i][j][k]=0;
                    }
                }
            }
        }
    }
    int ans=0;
    for(int j=0;j<(1<<m);j++)
    {
        for(int k=0;k<(1<<m);k++)
        {
            ans+=1LL*j*f[n][j][k]%N;
            //cout<<"!!"<<j<<" "<<f[n][j][k]<<endl;
            ans%=N;
        }
    }
    cout<<ans;
    return 0;
}
